/**
 * This file is part of Idegen, the application to create IDE project files.
 *
 * @copyright Copyright (c) 2011-2012, Walter Tamboer http://waltertamboer.nl
 * @file Idegen/Generator/VisualStudioGenerator.hpp
 */

#ifndef IDEGEN_GENERATOR_VISUALSTUDIOGENERATOR_HPP
#define IDEGEN_GENERATOR_VISUALSTUDIOGENERATOR_HPP

namespace Idegen
{
	class IGenerator;
	class IdegenProject;
	class IdegenSourceSet;
	class IdegenProjectFilter;
	struct IdegenProjectFile;

	typedef std::vector< IdegenSourceSet* > IdegenSourceSetList;
	typedef std::vector< IdegenProjectFile* > ProjectFileList;
	typedef std::vector< IdegenProjectFilter* > ProjectFilterList;

	/** The base class for all Visual Studio generators. */
	class VisualStudioGenerator: public IGenerator
	{
	public:
		/** Initializes a new instance of this class. */
		VisualStudioGenerator();
		
		/**
		 * Generates the project for this generator.
		 *
		 * @param[in] settings The settings used for generating.
		 * @param[in] generator The generator to output.
		 */
		virtual void Generate( Settings* settings, IdegenGenerator* generator );

	protected:
		/**
		 * Generates the project for this generator.
		 *
		 * @param[in] settings The settings used to parse.
		 * @param[in] project The project to create.
		 */
		virtual void GenerateProject( Settings* settings, IdegenProject* project ) = 0;

		/**
		 * Generates the solution file for this generator.
		 *
		 * @param[in] settings The settings used to parse.
		 * @param[in] generator The generator to create the solution for.
		 */
		virtual void GenerateSolution( Settings* settings, IdegenGenerator* generator ) = 0;

		/**
		 * Writes an element and its value.
		 *
		 * @param[in] parent The parent element.
		 * @param[in] name The element name to write.
		 * @return Returns the created element.
		 */
		TiXmlElement* WriteElement( TiXmlElement* parent, const std::string& name );

		/**
		 * Writes an element and its value.
		 *
		 * @param[in] parent The parent element.
		 * @param[in] name The element name to write.
		 * @param[in] value The element value to write.
		 * @return Returns the created element.
		 */
		TiXmlElement* WriteElementValue( TiXmlElement* parent, const std::string& name, const std::string& value );

		/** The output path. */
		std::string m_OutputPath;
	};
}

#endif
